project(rnapp)
cmake_minimum_required(VERSION 3.4.1)
set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
set(OH_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
set(WITH_HITRACE_SYSTRACE 1)
add_compile_definitions(WITH_HITRACE_SYSTRACE)


add_subdirectory("${RNOH_CPP_DIR}" ./rn)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-exception-handler/src/main/cpp" ./exception-handler)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-linear-gradient/src/main/cpp" ./linear-gradient)
#add_subdirectory("${OH_MODULE_DIR}/@react-native-ohos/react-native-webview/src/main/cpp" ./webview)
add_subdirectory("${OH_MODULES}/@react-native-ohos/push-notification-ios/src/main/cpp" ./push_notification)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-picker/src/main/cpp" ./picker)
add_subdirectory("${OH_MODULES}/@react-native-ohos/cookies/src/main/cpp" ./rn_cookies)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-fs/src/main/cpp" ./fs)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-fast-image/src/main/cpp" ./fast-image)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-splash-screen/src/main/cpp" ./splash_screen)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-gesture-handler/src/main/cpp" ./gesture-handler)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-safe-area-context/src/main/cpp" ./safe-area)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-document-picker/src/main/cpp" ./document_picker)
add_subdirectory("${OH_MODULES}/@react-native-ohos/checkbox/src/main/cpp" ./checkbox)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-text-size/src/main/cpp" ./text-size)
add_subdirectory("${OH_MODULES}/@react-native-ohos/rn-bugly/src/main/cpp" ./bugly)
#add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-video/src/main/cpp" ./video)
add_subdirectory("${OH_MODULES}/@react-native-ohos/masked-view/src/main/cpp" ./masked-view)
add_subdirectory("${OH_MODULES}/@react-native-ohos/netinfo/src/main/cpp" ./netinfo)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-svg/src/main/cpp" ./svg)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-permissions/src/main/cpp" ./permissions)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-marker/src/main/cpp" ./image-marker)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-print/src/main/cpp" ./print)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-toast/src/main/cpp" ./toast)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-screenshot-prevent/src/main/cpp" ./screenshot-prevent)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-fingerprint-scanner/src/main/cpp" ./fingerprint_scanner)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-udp/src/main/cpp" ./udp)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-send-intent/src/main/cpp" ./send_intent)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-default-preference/src/main/cpp" ./default_preference)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-view-pdf/src/main/cpp" ./pdf_view)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-performance/src/main/cpp" ./performance)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-contacts/src/main/cpp" ./contacts)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-camera-kit/src/main/cpp" ./camera-kit)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-file-viewer/src/main/cpp" ./file-viewer)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-get-random-values/src/main/cpp" ./get-random-values)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-orientation-locker/src/main/cpp" ./orientation-locker)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-track-player/src/main/cpp" ./track-player)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-inappbrowser-reborn/src/main/cpp" ./inappbrowser-reborn)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-rotate/src/main/cpp" ./imageRotate)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-http-bridge/src/main/cpp" ./http_bridge)
add_subdirectory("${OH_MODULES}/@react-native-ohos/platform-colors/src/main/cpp" ./platform_colors)
#add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-localization/src/main/cpp" ./localization)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-amap-geolocation/src/main/cpp" ./amap_geolocation)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-file-selector/src/main/cpp" ./file-selector)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-reanimated/src/main/cpp" ./reanimated)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-mail/src/main/cpp" ./mail)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-version-number/src/main/cpp" ./version_number)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-tts/src/main/cpp" ./tts)
add_subdirectory("${OH_MODULES}/@react-native-ohos/audio-toolkit/src/main/cpp" ./audio-toolkit)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-doc-viewer/src/main/cpp" ./doc-viewer)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-capinsets-next/src/main/cpp" ./image-capinsets-next)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-textinput-maxlength-fixed/src/main/cpp" ./textinput_maxlength_fixed)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-spring-scrollview/src/main/cpp" ./spring_scrollview)
#add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-bars/src/main/cpp" ./bars)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-file-access/src/main/cpp" ./file_access)
add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-sqlite-storage/src/main/cpp" ./sqlite_storage)

# RNOH_BEGIN: manual_package_linking_1
# RNOH_END: manual_package_linking_1

file(GLOB GENERATED_CPP_FILES CONFIGURE_DEPENDS "./generated/*.cpp")

add_library(rnoh_app SHARED
    ${GENERATED_CPP_FILES}
    "./PackageProvider.cpp"
    "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
)
target_link_libraries(rnoh_app PUBLIC rnoh_exception_handler)
target_link_libraries(rnoh_app PUBLIC rnoh_linear_gradient)
#target_link_libraries(rnoh_app PUBLIC rnoh_webview)
target_link_libraries(rnoh_app PUBLIC rnoh_push_notification)
target_link_libraries(rnoh_app PUBLIC rnoh_picker)
target_link_libraries(rnoh_app PUBLIC rnoh_cookies)
target_link_libraries(rnoh_app PUBLIC rnoh_fs)
target_link_libraries(rnoh_app PUBLIC rnoh_fast_image)
target_link_libraries(rnoh_app PUBLIC rnoh_document_picker)
target_link_libraries(rnoh_app PUBLIC rnoh)
target_link_libraries(rnoh_app PUBLIC rnoh_splash_screen)
target_link_libraries(rnoh_app PUBLIC rnoh_gesture_handler)
target_link_libraries(rnoh_app PUBLIC rnoh_safe_area)
target_link_libraries(rnoh_app PUBLIC rnoh_checkbox)
target_link_libraries(rnoh_app PUBLIC rnoh_text_size)
target_link_libraries(rnoh_app PUBLIC rnoh_bugly)
#target_link_libraries(rnoh_app PUBLIC rnoh_video)
target_link_libraries(rnoh_app PUBLIC rnoh_masked_view)
target_link_libraries(rnoh_app PUBLIC rnoh_netinfo)
target_link_libraries(rnoh_app PUBLIC rnoh_svg)
target_link_libraries(rnoh_app PUBLIC rnoh_permissions)
target_link_libraries(rnoh_app PUBLIC rnoh_image_marker)
target_link_libraries(rnoh_app PUBLIC rnoh_print)
target_link_libraries(rnoh_app PUBLIC rn_toast)
target_link_libraries(rnoh_app PUBLIC rnoh_screenshot_prevent)
target_link_libraries(rnoh_app PUBLIC fingerprint_scanner)
target_link_libraries(rnoh_app PUBLIC rnoh_udp)
target_link_libraries(rnoh_app PUBLIC rnoh_send_intent)
target_link_libraries(rnoh_app PUBLIC rnoh_default_preference)
target_link_libraries(rnoh_app PUBLIC rnoh_pdf_view)
target_link_libraries(rnoh_app PUBLIC rnoh_performance)
target_link_libraries(rnoh_app PUBLIC rnoh_contacts)
target_link_libraries(rnoh_app PUBLIC rnoh_camera_kit)
target_link_libraries(rnoh_app PUBLIC rnoh_file_viewer)
target_link_libraries(rnoh_app PUBLIC rnoh_get_random_values)
target_link_libraries(rnoh_app PUBLIC rnoh_orientation_locker)
target_link_libraries(rnoh_app PUBLIC rnoh_track_player)
target_link_libraries(rnoh_app PUBLIC rnoh_inappbrowser_reborn)
target_link_libraries(rnoh_app PUBLIC rnoh_imageRotate)
target_link_libraries(rnoh_app PUBLIC rnoh_platform_colors)
target_link_libraries(rnoh_app PUBLIC rnoh_http_bridge)
#target_link_libraries(rnoh_app PUBLIC rnoh_localization)
target_link_libraries(rnoh_app PUBLIC rnoh_amap_geolocation)
target_link_libraries(rnoh_app PUBLIC rnoh_file_selector)
target_link_libraries(rnoh_app PUBLIC rnoh_reanimated)
target_link_libraries(rnoh_app PUBLIC rnoh_mail)
target_link_libraries(rnoh_app PUBLIC rnoh_version_number)
target_link_libraries(rnoh_app PUBLIC rnoh_tts)
target_link_libraries(rnoh_app PUBLIC rnoh_audio_toolkit)
target_link_libraries(rnoh_app PUBLIC rnoh_doc_viewer)
target_link_libraries(rnoh_app PUBLIC rnoh_rn-image-capinsets)
target_link_libraries(rnoh_app PUBLIC rnoh_textinput_maxlength_fixed)
target_link_libraries(rnoh_app PUBLIC rnoh_spring_scrollview)
#target_link_libraries(rnoh_app PUBLIC rnoh_bars)
target_link_libraries(rnoh_app PUBLIC rnoh_file_access)
target_link_libraries(rnoh_app PUBLIC rnoh_sqlite_storage)

# RNOH_BEGIN: manual_package_linking_2
# RNOH_END: link_packages